home *** CD-ROM | disk | FTP | other *** search
/ Violence in 3D (Black Bird Entertainment) / Violence in 3D.iso / darkf / utils / dfuse091 / df_specs.doc < prev    next >
Encoding:
Text File  |  1995-05-04  |  39.1 KB  |  1,134 lines

  1. +===========================+
  2. | DARK FORCES SPECS v 0.9x  |
  3. +===========================+
  4.  
  5. Author : Yves BORCKMANS (yborckmans@abcomp.be (work))
  6.          (Please state the package version when you email me)
  7. Credits: Serge DEBROEYER
  8.                for adjoin/mirror tips, some flags, some INF tips,
  9.                    complex sectors, ...
  10.          Don SIELKE (DSielke@aol.com)
  11.                for the complete flags list, the -u option, ...
  12.  
  13.    +------------------------------------------------------------------------+
  14.    | Dark Forces is (c) LucasArts Entertainment Company                     |
  15.    | DOOM        is (c) iD Software                                         |
  16.    |                                                                        |
  17.    | None of these have anything to do with these totally unofficial specs, |
  18.    | and shouldn't be bothered with them in any way.                        |
  19.    +------------------------------------------------------------------------+
  20.  
  21. Welcome to the "DARK FORCES SPECS" !
  22.  
  23. As you will rapidly see, there are still a lot of unknown things in these specs.
  24. But as they are diminishing very quickly, I found it was time to write them
  25. down in a "formal" way, which can serve as a reference.
  26.  
  27. As always, nothing is as good as seeing how professionnals do it, so don't
  28. hesitate to go and see how the LucasArt team did it.
  29.  
  30. I will also try to explain differences with DOOM level making where applicable,
  31. so if you have experience in that domain, look for the DOOM markings.
  32.  
  33. Note : I will frequently use the following abbreviations
  34.  - DF  = Dark Forces
  35.  - LCE = LucasArts Entertainment Company
  36.  - SC  = sector
  37.  - WL  = wall
  38.  - VX  = vertex
  39.  - OB  = object
  40.  - TX  = texture
  41.  
  42. Changes since previous release have been marked [NEW].
  43.  
  44. +-------------------+
  45. | TABLE of CONTENTS |
  46. +-------------------+
  47.  
  48.   0. GENERAL DESCRIPTION [NEW]
  49.   x. GOB FILES
  50.   x. JEDI.LVL
  51.   x. LEV FILES
  52.   x. FLAGS       [NEW] complete values
  53.   x. INF FILES
  54.   x. GOL FILES
  55.   x. O   FILES
  56.   x. PAL FILES
  57.   x. CMP FILES
  58.   x. BM  FILES
  59.   x. FME FILES
  60.   x. WAX FILES
  61.   x. 3DO FILES
  62.   x. VOC FILES
  63.   x. MSG FILES
  64.   x. CHEAT CODES [NEW]
  65.  
  66. +-------------------------+
  67. |  0. GENERAL DESCRIPTION |
  68. +-------------------------+
  69.  
  70. Dark Forces contains a huge amount of files, and these are grouped by type in
  71. what are called GOB files. These are quite similar in principle to DOOM WAD
  72. files, but at a higher level. They serve as containers for other files which
  73. in turn contain information. DOOM WADS directly contain the information.
  74.  
  75. These files can be extracted from the GOB and worked upon, then be used in the
  76. game.
  77. LCE made a very good job at this :
  78.  1. if you place a file in your game directory, DF will take it there before
  79.     looking for it in its GOB.
  80.  2. if you launch DF with the -u option, it will look into the specified .gob
  81.     ( dark -umylevel.gob ). This is probably the best method to ditribute
  82.     levels. [NEW]
  83.  
  84. A very important file "JEDI.LVL" contains the names of all the levels in the
  85. game. Sadly, editing it doesn't work further than the briefing because the
  86. level names are hardcoded in dfbrief.lfd .
  87. What you CAN do however is change the levels titles there.
  88.  
  89. The levels themselves are each one composed of 6 files, found in dark.gob .
  90.  - name.LEV : geometry (static)      (DOOM SECTORS, LINEDEFS/SIDEDEFS, VERTEXES)
  91.  - name.INF : workings (dynamic)     (no DOOM equivalent except the TAG concept)
  92.  - name.GOL : goals                  (no DOOM equivalent)
  93.  - name.O   : objects                (DOOM THINGS)
  94.  - name.PAL : palette                (DOOM PLAYPAL 0 (not the 'hit' palettes))
  95.  - name.CMP : palette mappings       (DOOM COLORMAP)
  96.  
  97. Textures are stored in .BM  files, as are the weapons display, and so on.
  98. Sounds   are stored in .VOC files (normal Creative Labs format).
  99.  
  100. Objects  are stored in the following files depending on their type :
  101.  - obj.3DO  : 3D object (real 3D)
  102.  - obj.FME  : FRAME     (a "one view" object)
  103.  - obj.WAX  : SPRITE    (ie all the ennemies)
  104.  - obj.VOC  : SOUND     (any sound)
  105.  
  106. There are many other inexplored files, including but not limited to :
  107.  - briefings
  108.  - cutscenes
  109.  - fonts
  110.  - vues (in level animations : ie your vessel landing)
  111.  - music files
  112.  
  113. The following text will now become "quite technical" ...
  114.  
  115.  
  116. +----------------+
  117. |  x. GOB FILES  |
  118. +----------------+
  119.  
  120. GOB files are a repository for many other files. They contain a header with a
  121. signature, a data part and an index part.
  122.  
  123. Their structure follows :
  124.   +------------------------------------------------------------------------+
  125.   | 0000   GOB_MAGIC   char[4]      is 'GOB' followed by 0x0A              |
  126.   | 0004 +-MASTERX     long         offset to MASTERN                      |
  127.   |      |                          MASTERX+4 is the offset of FILE1 data  |
  128.   | 0008 | FILE1       bytes        data for FILE1                         |
  129.   | xxxx | FILE2       bytes        data for FILE2                         |
  130.   | .... |                          ...                                    |
  131.   | xxxx | FILEn       bytes        data for FILEn                         |
  132.   | yy   +>MASTERN     long         number of files in the GOB             |
  133.   | yy+4   INDEX1      GOB_INDEX    index to FILE1                         |
  134.   | yy+25  INDEX2      GOB_INDEX    index to FILE2                         |
  135.   | ....                            ...                                    |
  136.   | zzzz   INDEXn      GOB_INDEX    index to FILEn                         |
  137.   +------------------------------------------------------------------------+
  138.  
  139. The GOB_INDEX format is :
  140.   +------------------------------------------------------------------------+
  141.   | 0000   IX          long         offset of the start of the file        |
  142.   | 0003   LEN         long         lenght of the file                     |
  143.   | 0007   NAME        char[13]     name of the file                       |
  144.   +------------------------------------------------------------------------+
  145.  
  146. DOOM note : this structure is quite similar to that of a WAD file, the small
  147.             difference is that in WADS the MASTERN field is at the beginning
  148.             of the file, between WAD_MAGIC and MASTERX.
  149.  
  150. UNKNOWNS  : NONE
  151.  
  152. +----------------+
  153. |  x. LEV FILES  |
  154. +----------------+
  155.  
  156. LEV files contain a complete level geometry. They are in a very understandable
  157. but quite complex text format. They are also huge (generally > 600K).
  158. This isn't a problem, as you really cannot edit them as a text file, because of
  159. the many dependencies between the geometry elements.
  160.  
  161. x.1. BASICS
  162.      ______
  163.  
  164.      Geometry elements are :
  165.  
  166.       -VERTEX  : a point in a 2 dimension projection (X and Z)
  167.       -WALLS   : a line joining 2 vertices
  168.       -SECTOR  : a collection of walls
  169.                  generally closed but this isn't mandatory
  170.                  can contain "gaps" or other sectors
  171.  
  172.      As the game works with a two dimension projection, the third (Y)
  173.      dimension is coded at the sector level by a floor altitude and a ceiling
  174.      altitude. Note that this imply that floors and ceilings are always FLAT.
  175.  
  176.      Sectors can however be layered on top of one another to give a "full 3D"
  177.      feeling. This is a whole new concept for DOOM levels designers.
  178.  
  179.      Each sector is coded with its walls and vertices, and is completely self
  180.      contained (there is no DOOM like vertex and linedef sharing).
  181.      The relation between sectors is done at the wall level by the
  182.      adjoin/mirror/walk mechanism.
  183.  
  184.  
  185.      1--------2      Sector 1 has 5 vertices (0 to 4) marked 0 1 2 A B
  186.      |        |                   5 walls    including AB (wall 3)
  187.      |   S1   |
  188.      |        |      Sector 2 has 4 vertices (0 to 3) marked 0 1 B A
  189.      0---B====A                   4 walls    including BA (wall 2)
  190.          | S2 |
  191.          1----0
  192.  
  193.  
  194.      It is VERY important to note that there are 2 vertices at point A,
  195.      two vertices at point B and 2 walls marked ==== . As I said above,
  196.      sectors are self contained.
  197.  
  198.      So, to come back to the adjoin/mirror/walk mechanism, if S1 and S2
  199.      must be connected, an adjoin/mirror relation must be established.
  200.  
  201.      +----1---+
  202.      |        |
  203.      0        2
  204.      | 4    3 |
  205.      +---+====+
  206.          1  2 3
  207.          +--0-+
  208.  
  209.      This is quite simple : the adjoin is the number of the connected sector,
  210.      and the mirror is the number of the connexion wall.
  211.  
  212.      So we would need to set
  213.       - in S1 : W3.adjoin = S2 and W3.mirror = 2    AND
  214.       - in S2 : W2.adjoin = S1 and W2.mirror = 3
  215.  
  216.      For the walk values, we would need to set
  217.       - in S1 : W3.walk = S2
  218.       - in S2 : W2.walk = S1
  219.  
  220.      Just to be complete, if there is no adjoin/mirror/walk, the value is -1.
  221.  
  222.      Note to DOOM designers : there is no node building to do on these levels.
  223.      This is done at each load of the level by the DF exe and is very fast.
  224.  
  225.      [NEW] Correction to this: I'm not sure that a BSP is done at all !
  226.      There certainly are checks at level loading time, but a few tests on
  227.      complicated sectors seem to show 'errors' in texturing or HOM problems.
  228.      Try to create a big sector with say five imbricated 'circles' with
  229.      different altitudes.
  230.      Maybe you just have to try and create a few 'more convex' sectors instead.
  231.      If you want to create a BSP for LEV files, don't forget you cannot split
  232.      elevators nor change the walls numbers (triggers), so good luck !
  233.      More on this later.
  234.  
  235.  
  236.      A quick note on MID, TOP and BOT textures:
  237.  
  238.      When you have adjacent sectors:
  239.          TOP  is  ABOVE the ceiling of the other SC
  240.          BOT  is  BELOW the floor   of the other SC
  241.          MID  is  everywhere you can see through to the other SC
  242.  
  243.      Of course, the MID texture is not shown when walls are adjoined, so that
  244.      you can see through! (Note: WL flag 3, bit 1 forces it back in place)
  245.  
  246.      This is exactly the same as DOOM texturing, just note that there are two
  247.      different walls, not one linedef with two sidedefs.
  248.  
  249.  
  250. x.2. FILE DESCRIPTION
  251.      ________________
  252.  
  253.      The LEV file is composed of 4 parts :
  254.       - magic and version number
  255.       - general level info
  256.       - texture table
  257.       - geometry description ie sectors, walls, vertices data
  258.  
  259.      The following comments are accepted:
  260.  
  261.      # comment
  262.      DATA # comment
  263.  
  264.  
  265. x.2.1. Magic and version number
  266.        ------------------------
  267.  
  268.        This is trivial.
  269.  
  270.      | LEV 2.1
  271.  
  272. x.2.2. General Level Info
  273.        ------------------
  274.  
  275.        This part contains the following data (sample from secbase.lev):
  276.  
  277.      | LEVELNAME SECBASE
  278.      | PALETTE   SECBASE.PAL
  279.      | MUSIC     AVENGE.GMD
  280.      | PARALLAX  1024.0000 1024.0000
  281.  
  282.        LEVELNAME, PALETTE and MUSIC are self explanatory.
  283.        PARALLAX is unknown.
  284.  
  285.        [NEW]
  286.        After a little testing, it seems that this isn't used at all by DF.
  287.        (I even cannot find AVENGE.GMD !)
  288.  
  289. x.2.3. Texture Table
  290.        -------------
  291.  
  292.        As there is a lot of TX information in a level, a texture table is
  293.        created to avoid storing TX names in full at each occurrence.
  294.  
  295.        Coding sample :
  296.  
  297.      | TEXTURES 85         # number of textures
  298.      |  TEXTURE: TEX00.BM  # texture 0
  299.      |  TEXTURE: TEX01.BM  # texture 1
  300.      |  ...
  301.      |  TEXTURE: TEX84.BM  # texture 84
  302.  
  303.        Afterwards, all the TXs are refered to by their 0 based index in this
  304.        texture table.
  305.  
  306.  
  307. x.2.4. Geometry description
  308.        --------------------
  309.        The first data is the total number of sectors in the level :
  310.  
  311.      | NUMSECTORS number_of_sectors
  312.  
  313.        Then each sector is described, with its vertices and walls.
  314.        Please note that the wall data is on ONE line, but has been splitted
  315.        here for visual convenience.
  316.  
  317.      | SECTOR scnum
  318.      |  NAME             sector_name
  319.      |  AMBIENT          20
  320.      |  FLOOR TEXTURE    80 -0.38 -0.06 2
  321.      |  FLOOR ALTITUDE    0.00
  322.      |  CEILING TEXTURE  0  0.00  0.00 2
  323.      |  CEILING ALTITUDE -12.00
  324.      |  SECOND ALTITUDE   0.00
  325.      |  FLAGS            0 0 0
  326.      |  LAYER            1
  327.      |
  328.      | VERTICES vxnum
  329.      |  X: 252.00 Z: 224.00 # a vx
  330.      |  ...
  331.      |
  332.      | WALLS wlnum
  333.      |  WALL LEFT:  0 RIGHT:  1 
  334.      \       MID:   0  0.00  0.00 0
  335.      \       TOP:   1  0.00  0.00 0
  336.      \       BOT:   2  0.17  0.00 0
  337.      \       SIGN: -1  0.00  0.00
  338.      \       ADJOIN: 57 MIRROR: 0 WALK: 57
  339.      \       FLAGS: 0 0 0
  340.      \       LIGHT: 5
  341.      |  ...
  342.  
  343.  
  344.        Hmmm... heavy information!
  345.        Let's take it line by line, it's not too difficult.
  346.  
  347.      | SECTOR scnum
  348.  
  349.        This is the sector number, it is zero based.
  350.  
  351.      |  NAME             sector_name
  352.  
  353.        This is both a link to the .INF file and a useful reminder.
  354.  
  355.      |  AMBIENT          20
  356.  
  357.        Ambient light level in this sector.
  358.  
  359.      |  FLOOR TEXTURE    80 -0.38 -0.06 2
  360.  
  361.        The TX to apply to the floor of the SC as an index in the TX table.
  362.        The following two floats are the X and Z offsets by which the TX must
  363.        be moved before being mapped.
  364.        The third (int) value is unknown.
  365.        It seems that floor textures must be 64x64, or the game engine does
  366.        strange things.
  367.  
  368.      |  FLOOR ALTITUDE    0.00
  369.  
  370.        The altitude of the floor of this SC. Note that the Y axis goes "down",
  371.        so higher altitudes have lower values.
  372.  
  373.      |  CEILING TEXTURE  0  0.00  0.00 2
  374.      |  CEILING ALTITUDE -12.00
  375.  
  376.        Same as floor.
  377.  
  378.      |  SECOND ALTITUDE   0.00
  379.  
  380.        This is used to indicate a second "floor" altitude in a sector.
  381.        For instance, a second altitude of 4 will make you "enter into the floor"
  382.        4 deep. It will in addition make the sector waterlike and generate a
  383.        splashing sound.
  384.        If you set a negative second altitude, you will be able to walk higher on
  385.        the sector, provided you also enter the sector higher. This is the way
  386.        platforms are created (the platform object is only a visual clue).
  387.  
  388.      |  FLAGS            0 0 0
  389.  
  390.        Three flags, the second of which is never used in the 14 original levels.
  391.        Change various things in the sector. - Described below.
  392.  
  393.      |  LAYER            1
  394.  
  395.        The layer on which the SC is (positive, 0 or negative).
  396.        This value is used in the game to make different maps corresponding to
  397.        zones of altitude.
  398.        Note that this is only a logical grouping.
  399.  
  400.  
  401.      | VERTICES vxnum
  402.  
  403.        This is the number of vertices that this SC has.
  404.  
  405.      |  X: 252.00 Z: 224.00 # a vx
  406.  
  407.        List of the VXs. X and Z are trivial.
  408.  
  409.      | WALLS wlnum
  410.  
  411.        This is the number of walls that this SC has.
  412.  
  413.  
  414.      \  WALL LEFT:  0 RIGHT:  1
  415.  
  416.        These are the origin and destination vertices for this wall.
  417.  
  418.      \       MID:   0  0.00  0.00 0
  419.  
  420.        The TX to apply to the middle of the WL as an index in the TX table.
  421.        The following two floats are the X and Y offsets by which the TX must
  422.        be moved before being mapped (remember Y goes down).
  423.        The third (int) value is unknown.
  424.  
  425.      \       TOP:   1  0.00  0.00 0
  426.  
  427.        The TX to apply to the top of the WL as an index in the TX table.
  428.        The following two floats are the X and Y offsets by which the TX must
  429.        be moved before being mapped (remember Y goes down).
  430.        The third (int) value is unknown.
  431.  
  432.      \       BOT:   2  0.17  0.00 0
  433.  
  434.        The TX to apply to the bottom of the WL as an index in the TX table.
  435.        The following two floats are the X and Y offsets by which the TX must
  436.        be moved before being mapped (remember Y goes down).
  437.        The third (int) value is unknown.
  438.  
  439.      \       SIGN: -1  0.00  0.00
  440.  
  441.        A sign is a second TX on the same WL, its main use is to place switches.
  442.        First is the TX to apply to a sign on the WL as an index in the TX table.
  443.        The following two floats are the X and Y offsets by which the TX must
  444.        be moved before being mapped (remember Y goes down). Also note that this
  445.        is relative to the texturing of the wall. So if you offset the WALL, you
  446.        have to add this offset to that of the SIGN.
  447.  
  448.      \       ADJOIN: 57 MIRROR: 0 WALK: 57
  449.  
  450.        See the BASICS section.
  451.  
  452.      \       FLAGS: 0 0 0
  453.  
  454.        Three flags.
  455.        Change various things in the wall. - Described below.
  456.  
  457.      \       LIGHT: 5
  458.  
  459.        Relative modification of the luminosity on this specific WL.
  460.  
  461.  
  462.        So this is it for the LEV files. As you can see, it is totally
  463.        impossible to edit as text, except perhaps to change a TX name in the
  464.        TX table, which is an ultra fast way to relook a level !
  465.  
  466.  
  467. UNKNOWNS  : PARALLAX
  468.             the int value after textures offsets
  469.  
  470. +----------------+
  471. |  x. FLAGS      | [NEW] Complete info
  472. +----------------+
  473.  
  474. These are the currently known values for the various sector and wall flags.
  475.  
  476. x.1. SECTOR FLAGS
  477.      ------------
  478.  
  479.      * FLAG 1
  480.  
  481.      +-----------------------------------+
  482.      |      1 EXTERIOR - NO CEIL.  (SKY) |
  483.      |      2 DOOR                       | instant door
  484.      |      4 SHOT REFLEXION / MAG.SEAL  | walls reflect weapon shots
  485.      |      8 EXTERIOR ADJOIN            | for adjacent skys with != alt.
  486.      |     16 ICE FLOOR        (SKATING) |
  487.      |     32 SNOW FLOOR                 |
  488.      |     64 EXPLODING WALL/DOOR        | instant exploding door
  489.      |    128 EXTERIOR - NO FLOOR  (PIT) |
  490.      |    256 EXTERIOR FLOOR ADJOIN      | for adjacent pits with != alt.
  491.      |    512 CRUSHING SECTOR            |
  492.      |   1024 NO WALL DRAW / "HORIZON"   | horizon moves with eye level
  493.      |   2048 LOW  DAMAGE                |
  494.      |   4096 HIGH DAMAGE   (both = GAS) | both can be combined for GAS
  495.      |   8192 NO SMART OBJECT REACTION   |
  496.      |  16384 SMART OBJECT REACTION      |
  497.      |  32768 SUBSECTOR                  | player won't follow moving SC
  498.      |  65536 SAFE SECTOR                |
  499.      | 131072 RENDERED     (do not use!) |
  500.      | 262144 PLAYER       (do not use!) |
  501.      | 524288 SECRET SECTOR              | increments the %secret when entered
  502.      +-----------------------------------+
  503.  
  504.      * FLAG 2 isn't used in the 14 original levels.
  505.  
  506.      * FLAG 3 only serves as an extra lighting value in TALAY.
  507.  
  508.  
  509. x.2. WALL FLAGS
  510.      ----------
  511.  
  512.      * FLAG 1
  513.      +-----------------------------------+
  514.      |     1 ADJOINING MID TX            | the MID TX is NOT removed
  515.      |     2 ILLUMINATED SIGN            |
  516.      |     4 FLIP TEXTURE HORIZONTALLY   |
  517.      |     8 ELEV CAN CHANGE WALL LIGHT  |
  518.      |    16 WALL TX ANCHORED            |
  519.      |    32 WALL MORPH WITH SECTOR      |
  520.      |    64 ALLOW SCROLL TOP  TX        |
  521.      |   128 ALLOW SCROLL MID  TX        |
  522.      |   256 ALLOW SCROLL BOT  TX        |
  523.      |   512 ALLOW SCROLL SIGN TX        |
  524.      |  1024 HIDE ON MAP                 |
  525.      |  2048 SHOW ON MAP                 |
  526.      |  4096 SIGN ANCHORED               |
  527.      |  8192 WALL DAMAGES PLAYER         |
  528.      | 16384 SHOW AS LEDGE ON MAP        |
  529.      | 32768 SHOW AS DOOR  ON MAP        |
  530.      +-----------------------------------+
  531.  
  532.      * FLAG 2 is unused.
  533.  
  534.      * FLAG 3
  535.      +-----------------------------------+
  536.      |     1 CAN ALWAYS WALK             |
  537.      |     2 CANNOT WALK THROUGH WALL    |
  538.      |     4 FENCE - KEEP ENNEMIES IN    |
  539.      |     8 CANNOT FIRE THROUGH WALL    |
  540.      +-----------------------------------+
  541.  
  542. +----------------+
  543. |  x. INF FILES  |
  544. +----------------+
  545.  
  546. INF files are text files written in "the INF programming language".
  547. They accept C like  /* */  comments.
  548. They are linked to the SCs via the SC names, and
  549.                 to the WLs via the SC names and WL number.
  550.  
  551. The basic items defined in the .INF are
  552.  - triggers  : * they trigger something in their 'clients'.
  553.  - elevators : * they receive messages and act upon them,
  554.                  possibly sending other messages, and so on.
  555.                * they may also have 'slaves' following their every action.
  556.  
  557. Elevators are to be taken very widely :
  558.      elevator basic
  559.      elevator change_light
  560.      elevator change_wall_light
  561.      elevator door
  562.      elevator door_mid
  563.      elevator inv
  564.      elevator morph_move1
  565.      elevator morph_move2
  566.      elevator morph_spin1
  567.      elevator morph_spin2
  568.      elevator move_ceiling
  569.      elevator move_fc       (floor and ceiling together use @ stops !)
  570.      elevator move_floor
  571.      elevator rotate_wall
  572.      elevator scroll_ceiling
  573.      elevator scroll_floor
  574.      elevator scroll_wall
  575.  
  576. The variables in the language are the positions of the elevators created by
  577. the programmer (a lot of them in "dummy" (ie never accessible) sectors).
  578. Those positions are marked by 'stop:' keywords. The values following may be
  579. absolute or relative in which case they are prepended with a '@'. Note that
  580. the 'stop' unit is dependent of the elevator type. It may be floor altitude,
  581. ceiling altitude, ambient or light level, degrees ...
  582.  
  583. The whole thing works by triggering/sending messages across the items and
  584. reacting to them differently depending on the "variables". Other actions can
  585. also be executed, such as adjoining, terminating, pausing and waking up (OB),
  586. playing a sound, playing an animation, ...
  587.  
  588. Here is a quick list of some of the messages :
  589.      [stop] [sector]
  590.      [stop] [sector[(wall)]] clear_bits            flagnum bitnum
  591.      [stop] [sector]         complete              num
  592.      [stop] [sector[(wall)]  done
  593.      [stop] [sector]         goto_stop             num
  594.      [stop] [sector]         master_on             [value]
  595.      [stop] [sector]         master_off            [value]
  596.      [stop] [sector[(wall)]] m_trigger             [value]
  597.      [stop] [sector]         next_stop
  598.      [stop] [sector]         prev_stop
  599.      [stop] [sector[(wall)]] set_bits              flagnum bitnum
  600.      [stop] [sector]         wakeup
  601.      [stop] system           lights            (in TALAY uses SC flag 3)
  602.      trigger                           ??      (in FUELSTAT.INF line 391)
  603.  
  604. The [stop] is the stop at which the message will be send. 
  605. So when you look at an INF file and you see something like :
  606.  
  607.    class: elevator EEEEEE
  608.     stop: 0
  609.           message: 0 MMMMMM
  610.     stop: 1
  611.           message: 1 MMMMMM
  612.  
  613. it's only a visual clue, and you could group all the messages in one place and
  614. in any order. Important : if you add a stop, you may have to renum !
  615.  
  616. Note that the elevators START at their stop 0, but the messages are send when
  617. the elevators ARRIVE at a stop. So the messages set up at stop 0 won't be
  618. send at level startup.
  619.  
  620. And a list of the triggers :
  621.      trigger
  622.      trigger single
  623.      trigger switch1
  624.      trigger standard
  625.      trigger toggle
  626.  
  627. The triggers react only to determinate events : this is called the event_mask.
  628. Some possible values follow :
  629.  
  630.        1 WALK FROM INSIDE          ( line   trigger )
  631.        2 WALK FROM OUTSIDE         ( line   trigger )
  632.        4 ENTER SECTOR              ( sector trigger )
  633.        8 LEAVE SECTOR              ( sector trigger )
  634.       16 NUDGE FROM INSIDE         ( sector / line  )
  635.       32 NUDGE FROM OUTSIDE        ( sector / line  )
  636.       64 ??
  637.      128 ??
  638.      256 FIRE                      ( line trigger with entity_mask: 8 )
  639.      512 ?? used once in ARC.INF
  640.  
  641. If you want to use a 'fire on it' trigger, you have to change the
  642. entity_mask (ie what do you use to trigger) to 8.
  643. If you want to both fire and nudge for instance, use entity_mask: *
  644.  
  645. The programming language is a little object oriented like, as you have default
  646. items in which you override only the fields you need. It is very powerful, and
  647. lets you to a certain extent dynamically modify the level.
  648.  
  649. Here are some basic values (of course, not all elevators have them all!) :
  650.      MASTER      (master item switch : may be on or off)
  651.      EVENT_MASK
  652.      SPEED
  653.      CENTER
  654.      ANGLE
  655.  
  656. As I don't have the time to compile a formal definition of the language, I give
  657. you the following advise : use a GREP like utility to generate a list of
  658. triggers, messages and elevators from all the .INF in the game, complete with
  659. filename and line numbers. This will make you a "reference" very useful to go
  660. and see how the LCE programmers do it.
  661.  
  662. Note : don't forget to change the 'items' value when you modify an INF.
  663.  
  664. To DOOM level makers : this may seem complicated, but I remember a WAD of mine
  665. with a long corridor with 19 consecutive linedefs doing modifications to the
  666. look of the level... then I remember spacing the linedefs so that some actions
  667. where finished before some others... then the player ran in the corridor...
  668.  
  669.  
  670. UNKNOWNS  : FORMAL FULL DESCRIPTION
  671.  
  672. +----------------+
  673. |  x. GOL FILES  |
  674. +----------------+
  675.  
  676. GOL files contain a description of what to do to complete the levels.
  677.  
  678. Sample code:
  679.  
  680.      | GOL 1.0
  681.      | GOAL: 0       ITEM:   5       # DT weapon
  682.      | GOAL: 1       TRIG:   1
  683.  
  684. Each GOAL: can be a TRIG: to fire or an ITEM: to take.
  685.  
  686. 'Goal triggers' are fired in the .INF file with the 'complete num' keyword sent
  687. to the complete sector (don't get confused here!).
  688.  
  689. For instance,   " message: s complete complete 1 "
  690. will say that TRIG: 1 is complete!
  691.  
  692.  
  693. 'Goal objects' fire internal triggers because of their logic. That internal
  694. trigger seems to be equivalent to " message: s complete next_stop "
  695. So, be sure that complete is at a correct hold point when the object is taken.
  696. Try to do nothing else in complete than handling the goals.
  697. If necessary, start another 'level control' elevator very early.
  698.  
  699. Object numbers are in an internal table at runtime.
  700. The broken Dark Trooper weapon for instance has the number 5 (see TALAY.GOL).
  701. If you want to make the player retrieve it in a SECBASE modification, just
  702. change the value of item to 5 in SECBASE.GOL (don't forget to put this object
  703. in your .O file).
  704. The message on the screen will be correct because the object has
  705. LOGIC: DT_WEAPON, and your OBJectives screen will be updated.
  706. But note that it still says 'retrieve death star plans'. Changing that means
  707. understanding the lfd format (which is most probably graphical !).
  708.  
  709. Here are the screen messages associated with the goal objects, you can patch
  710. them in text.msg .
  711.  
  712.      | 400  1:  "Death Star Plans"       for object 0
  713.      | 401  1:  "Phrik Metal"            for object 1
  714.      | 402  1:  "Nava Card"              for object 2
  715.      | 405  1:  "Dark Trooper Weapon"    for object 5
  716.      | 406  1:  "Data Tape"              for object 4
  717.  
  718. Object 6 is 'Your Gear' as used in the JABSHIP level and has the text
  719.  
  720.      | 312  1:  "Your Gear"
  721.  
  722. in the 'Power-Up Pickup Messages' section of the same text.msg file.
  723.  
  724.  
  725. Final note: don't assume the goals will happen in the .GOL order !
  726.  
  727.  
  728. +----------------+
  729. |  x. O   FILES  |
  730. +----------------+
  731.  
  732. O files contain all the level objects.
  733. They are in a very understandable but a little complex text format.
  734. They accept C like  /* */  comments.
  735.  
  736. x.1. BASICS
  737.      ______
  738.  
  739.      There are many different object types in Dark Forces:
  740.  
  741.       - SPIRIT : the player.
  742.       - SAFE   : a restart point after the player died.
  743.                  You should put SAFEs in your levels, because it seems to be
  744.                  the best bet as 'player starting points' if LCE produces a
  745.                  multiplayer version. (Put 8+ of them so you'll be ... safe!)
  746.       - SPRITE : fully animated objects such as ennemies.
  747.       - FRAME  : "one view" objects such as energy power ups.
  748.       - 3D     : 3D objects such as mousebots.
  749.       - SOUND  : an ambient sound around the object position.
  750.  
  751. x.2. FILE DESCRIPTION
  752.      ________________
  753.  
  754.      The O file is composed of 4 parts :
  755.       - magic and version number
  756.       - level name
  757.       - objects tables
  758.       - object descriptions
  759.  
  760.  
  761. x.2.1. Magic and version number
  762.        ------------------------
  763.  
  764.        This is trivial.
  765.  
  766.      | O 1.1
  767.  
  768. x.2.2. Level Name
  769.        ----------
  770.  
  771.      | LEVELNAME SECBASE
  772.  
  773. x.2.3. Object tables
  774.        -------------
  775.  
  776.        As there is a lot of OB information in a level, 4 object tables are
  777.        created to avoid storing OB names in full at each occurrence.
  778.  
  779.        Coding sample :
  780.  
  781.  
  782.      | PODS 3             # These are the "3D" objects
  783.      |  POD: DEATH.3DO    # 00
  784.      |  ...
  785.      |
  786.      | SPRS 10
  787.      |  SPR: OFFCFIN.WAX  # 00
  788.      |   ...
  789.      |
  790.      | FMES 6
  791.      |  FME: IENERGY.FME  # 00
  792.      |  ...
  793.      |
  794.      | SOUNDS 1
  795.      |  SOUND: BANG.VOC  #00
  796.      |  ...
  797.  
  798.        Afterwards, all the OBs are refered to by their 0 based index in the
  799.        object tables. The object CLASS determines in which table to look.
  800.  
  801. x.2.4. Object descriptions
  802.        -------------------
  803.  
  804.        The first data is the total number of objects in the level :
  805.  
  806.      | OBJECTS 185
  807.  
  808.        Then each object is described.
  809.        Please note that the object data first line has been splitted here for
  810.        visual convenience.
  811.  
  812.      | CLASS: SPIRIT       DATA:  0 X: 131.00 Y:   0.00 Z: 210.00
  813.                                   PCH:   0.00 YAW: 176.34 ROL:   0.00
  814.                                   DIFF: 1
  815.      |  SEQ
  816.      |   LOGIC:     PLAYER
  817.      |   EYE:       TRUE
  818.      |  SEQEND
  819.      |
  820.      | CLASS: SPRITE       DATA:  0 X: 320.62 Y:  20.00 Z: 275.64
  821.      \                            PCH:   0.00 YAW: 270.00 ROL:   0.00
  822.      \                            DIFF: 1
  823.      |  SEQ
  824.      |   TYPE:      I_OFFICER
  825.      |  SEQEND
  826.  
  827.        This is quite easy : CLASS is the type of object, and DATA is the
  828.        offset in the corresponding object table (SPIRIT and SAFE have DATA = 0).
  829.  
  830.        X, Y, Z are trivial.
  831.  
  832.        PCH, YAW, ROL are classic spatial orientation, but only YAW is really
  833.        used (DOOM equivalent is THING orientation). It takes a value in degrees
  834.        where 0 is at the "top of the screen when you look at the map". The
  835.        value increases clockwise.
  836.  
  837.        DIFF is the difficulty level at which the object appears.
  838.  
  839.         +------+------------------+
  840.         | DIFF | EASY   MED  HARD |
  841.         +------+------------------+
  842.         |  -3  |   X     X     X  |
  843.         |  -2  |   X     X        |
  844.         |  -1  |   X              |
  845.         |   0  |   X     X     X  |
  846.         |   1  |   X     X     X  |
  847.         |   2  |         X     X  |
  848.         |   3  |               X  |
  849.         +------+------------------+
  850.  
  851.        SEQ and SEQEND are delimiters for a series of options/modifiers to apply
  852.        to the object. They determine part of its behaviour.
  853.        For instance, if you take a mousebot and set it the SEQ...SEQEND of a
  854.        stormtrooper, you'll end up with an unmoving lifeless mousebot.
  855.  
  856.        The other use of this is to create object generators.
  857.        Here is a quite self explaining sample:
  858.  
  859.  
  860.      | CLASS: SPRITE       DATA:  4 X: 396.88 Y:  -2.00 Z: 217.48
  861.      \                            PCH:   0.00 YAW:   0.00 ROL:   0.00 DIFF: 1
  862.      |  SEQ
  863.      |   LOGIC:     GENERATOR STORM1
  864.      |   DELAY:     0
  865.      |   INTERVAL:  20
  866.      |   MAX_ALIVE: 1
  867.      |   MAX_DIST:  200
  868.      |   MIN_DIST:  70
  869.      |   NUM_TERMINATE: 3
  870.      |  SEQEND
  871.  
  872.       What is not clear is WHEN they are generated. What I know is that they
  873.       are never generated while you look directly at the generator !
  874.  
  875. UNKNOWNS  : FORMAL FULL DESCRIPTION
  876.             exact generator workings
  877.             the working of kyl3do (your ship)
  878.  
  879.  
  880. +----------------+
  881. |  x. PAL FILES  |
  882. +----------------+
  883.  
  884. PAL files store a single 256 colors palette as 256 x 3 RGB bytes.
  885. Each level can have its own palette.
  886.  
  887. UNKNOWNS  : NONE
  888.  
  889.  
  890. +----------------+
  891. |  x. CMP FILES  |
  892. +----------------+
  893.  
  894. CMP file seem to store palette mappings (like DOOM COLORMAP).
  895. They contain 32 times 256 bytes for light levels 0 to 31.
  896.  
  897. Note that colors from 0 to 31 are never modified. Keep this in mind if you
  898. design textures. They can follow the lights or not at your own convenience.
  899.  
  900. There are 128 other unknown bytes at the end of the file forming a slow
  901. gradient from 0x00 to 0x1F. I don't know what they are for.
  902.  
  903.  
  904. +----------------+
  905. |  x. BM  FILES  |
  906. +----------------+
  907.  
  908. Here is the C structure for the BM file header.
  909.  
  910. struct BM_header
  911. {
  912.  char      MAGIC[4];
  913.  int       SizeX;           /* if X = 1 then multiple BM in the file */
  914.  int       SizeY;           
  915.  int       idemX;
  916.  int       idemY;
  917.  byte      transparent;     /* 0x36 for normal, 0x3E for transparent */
  918.  byte      logSizeY;        /* ie logSizeY = log2(SizeY)             */
  919.  int       Compressed;      /* 0 = not compressed, 1 = compressed    */
  920.  long      DataSize;        /* excluding header                      */
  921.  char      filler[12];
  922. };
  923.  
  924. Please note that BMs must have a height which is a power of 2.
  925.  
  926. The data follows, encoded by COLUMNS from the bottom to the top.
  927.  
  928. Transparent BMs :
  929. ---------------
  930.  
  931. You can transform any BM in a 'transparent' BM by changing its transparent
  932. value from 0x36 to 0x3E. The color 0 will 'disappear'.
  933. Note that this isn't the same color as the one used in DOOM transparent
  934. textures (cyan in the DOOM palette).
  935.  
  936. Multiple BMs    :
  937. ------------
  938.  
  939. If SizeX == 1 BM file contains idemY BMs.
  940. There follow two bytes, the first of which permits to distinguish between
  941. 'switches' (if == 0) and 'animated textures'. It is the speed of animation
  942. (maybe in frames per second). You may alter this value if you want to.
  943. The second is 2.
  944. Then follows a table of offsets to the 'sub' BMs composed of idemY BMs.
  945. Each 'sub' BM then has its own header WITHOUT the MAGIC field (ie 28 bytes),
  946. with some slight modifications (I'll check later!).
  947.  
  948. Important note: for a multiple BM to work correctly, it must be made a 'SIGN',
  949. AND for switches there MUST also exist a corresponding trigger in the .INF
  950. Else, switches will be displayed wrong (as a single column) and the animated
  951. will display correctly, but static. This means that you cannot do animated
  952. floors and ceilings this way!
  953.  
  954.  
  955. Compressed BMs  :
  956. --------------
  957.  
  958. If compressed == 1  BM is compressed.
  959. These existed in the DEMO (buyit.bm), but I'm not sure if there are any in the
  960. full game. They use a mixed direct/RLE coding. In the demo, wait.bm also used
  961. yet another coding, but it's a perfectly normal BM in the full game.
  962.  
  963. Here we go. Fasten seat belts!
  964.  
  965. The heart of the data is a 'columns starts' table, with the start addresses of
  966. each of the columns. It is at the end of the file, at offset DataSize,
  967. and has one long entry per column containing this column start address.
  968. This start address is calculated without the 32 bytes BM header
  969. (ie read the header in a struct, then the data in a HUGE buffer at offset 0).
  970.  
  971. The coding of one column follows (in a pseudo pseudocode format!).
  972.  
  973.  while(end of data for this column not reached)
  974.  {
  975.   if(buffer[adr] <= 128)
  976.     the FOLLOWING n bytes are direct values
  977.   else
  978.     the FOLLOWING byte is a color byte to repeat n-128 times
  979.  }
  980.  
  981. There was an 0xFF last byte marker per column. However,I do prefer to
  982. calculate the end of the column data by using the start of next column, as
  983. this is more like the FME and WAX reading technique.
  984.  
  985. A slight variation of this compression is used in the frames and the sprites.
  986.  
  987. You may unfasten your seat belts!
  988.  
  989.  
  990. +----------------+
  991. |  x. FME FILES  |
  992. +----------------+
  993.  
  994. Contains the frames, which are the "one view" objects
  995. (you can turn around them, and always see the same image).
  996.  
  997. Here are the C structures for the FME file headers.
  998.  
  999. struct FME_header1
  1000. {
  1001.  long  u1;
  1002.  long  u2;
  1003.  long  u3;
  1004.  long  header2;         /* this is the absolute adress of header2 */
  1005.  char  unknown[16];
  1006. }
  1007.  
  1008. struct FME_header2
  1009. {
  1010.  int   SizeX;
  1011.  int   u1;
  1012.  int   SizeY;
  1013.  int   u2;
  1014.  int   Compressed;
  1015.  int   u3;
  1016.  long  DataSize;
  1017.  char  fil[8];
  1018. };
  1019.  
  1020. There are at least two formats for these.
  1021. If Compressed == 0 the format it very similar to the BM format, with just the
  1022. header rearranged.
  1023. The header 1 is totaly unknown except for the field header2.
  1024. The header 2 contains the X and Y sizes, and the data follows, encoded
  1025. by COLUMNS from the bottom to the top.
  1026.  
  1027. With Compressed == 1, the format looks like the compressed BM used in the demo
  1028. level, also with the header modifications (see).
  1029.  
  1030. Four differences :
  1031.  * the 'column starts' table is at the top of the file, just after the header.
  1032.  * you have to offset the adresses by -24 (they counted only header 1 ?)
  1033.  * the end of column data marker isn't there.
  1034.  * the backgroud color is always 0 (transparent) and ISN'T CODED.
  1035.    (there was a color byte in the BM compressed format).
  1036.  
  1037. There are two negative longs right at the beginning of header 1 that I don't
  1038. understand.
  1039.  
  1040. UNKNOWNS  : what's in FME_header1
  1041.  
  1042.  
  1043. +----------------+
  1044. |  x. WAX FILES  |
  1045. +----------------+
  1046.  
  1047. Contains the sprites.
  1048. (samples : STORMTROOPERS, BONUS LIVES ...)
  1049.  
  1050. These are a collection of embedded FME files. They contain a table with
  1051. 32 entries (offset to first entry = 0x000000BC). Each of these entry points to
  1052. a table containing adresses of a complete embedded enhanced FME file.
  1053. Take care to read that one properly (ie using the header2 offset in header1)
  1054. as there are multiple consecutive header1 !
  1055.  
  1056. As I began to wrote a viewer for these, I tried all the 32 first table entries
  1057. for a few waxes. Though they followed a different path through the pointers in
  1058. the file, I always get the same image ??? I'll try to find more later.
  1059.  
  1060. UNKNOWNS  : exact FILE FORMAT and details
  1061.  
  1062.  
  1063. +----------------+
  1064. |  x. 3DO FILES  |
  1065. +----------------+
  1066.  
  1067. Contains the "3D" objects.
  1068. (samples : MOUSEBOT, the DEATH STAR HOLOGRAM, ...)
  1069.  
  1070. These are text files containing a geometric description of a full 3D object.
  1071. I really don't have time now, but it should be quite easy to understand.
  1072.  
  1073. UNKNOWNS  : everything!
  1074.  
  1075. +----------------+
  1076. |  x. VOC FILES  |
  1077. +----------------+
  1078.  
  1079. Contains the sounds.
  1080. These are standard .VOC files in the Creative Labs format.
  1081.  
  1082. +----------------+
  1083. |  x. MSG FILES  |
  1084. +----------------+
  1085.  
  1086. Contains the text messages used in the game.
  1087.  
  1088. local.msg contains error messages and should be left untouched.
  1089. text.msg  however can be patched. The use of this is to create new messages
  1090.           that you can use in your levels (create a trigger, use text: ttt).
  1091.  
  1092. General format:
  1093.  
  1094.      | MSG 1.0
  1095.      |
  1096.      | MSGS 119
  1097.      |
  1098.      | # internal game messages
  1099.      | 0    0:  "Joystick Off"
  1100.      | ...
  1101.      | END
  1102.  
  1103. MSGS is the number of messages. Don't forget to update it if you add messages.
  1104.  
  1105. I found no problems by adding messages at 900 and more.
  1106.  
  1107.      | 900  1:  "Hurry up !"
  1108.  
  1109. I don't know what the second number (ie 0:) is for. I use 1:
  1110.  
  1111. Here are also the 'cheat messages' from 700 onwards. Just so you know where to
  1112. insert a few 'Cheater!' and 'Chicken Mode ON' ...
  1113.  
  1114. +------------------+
  1115. |  x. CHEAT CODES  | [NEW]
  1116. +------------------+
  1117.  
  1118. Just in case you haven't found them anywhere else !
  1119. I've also shown the equivalent cheat for DOOMers.
  1120.  
  1121. LABUG      bug mode
  1122. LACDS      map with things               (IDDT x2)
  1123. LADATA     coordinates & %secret         (IDMYPOS)
  1124. LAIMLAME   total invincibility           (IDDQD)
  1125. LANTFH     teleport to a safe
  1126. LAPOGO     allow to climb any height     (IDSPISPOPD / IDCLIP w/o walking thru)
  1127. LAPOSTAL   get weapons and ammo          (IDFA)
  1128. LARANDY    weapon super charge
  1129. LAREDLITE  freeze ennemies
  1130. LASKIP     finishes current level
  1131. LAUNLOCK   get all the keys              (the 'K' of IDKFA)
  1132.  
  1133. LAlevel    jump to level                 (IDCLEV)
  1134.